import { handleRequest } from './index';
import Qs from 'qs'


// 获取-安全责任指标考核记录列表
export function getExamRecordList(data) {
    return handleRequest({
        url: '/safety-check/query',
        method: 'post',
        data
    })
}

// 查看-安全责任指标考核记录详情
export function getRecordDetailByDraft(params) {
    return handleRequest({
        url: '/safety-check',
        method: 'get',
        params
    })
}

// 查看-安全责任指标考核记录详情(待确认)
export function getRecordDetailByAudit(params) {
    return handleRequest({
        url: '/safety-check-confirm',
        method: 'get',
        params
    })
}

// 新增-安全责任指标考核记录
export function addExamRecord(data) {
    return handleRequest({
        url: '/safety-check',
        method: 'post',
        data
    })
}

// 修改-安全责任指标考核记录
export function updateExamRecord(data) {
    return handleRequest({
        url: '/safety-check/update',
        method: 'post',
        data
    })
}

// 删除-安全责任指标考核记录
export function deleteExamRecord(params) {
    return handleRequest({
        url: '/safety-check',
        method: 'post',
        params
    })
}

// 安全责任指标考核确认
export function confirmExamRecord(data) {
    return handleRequest({
        url: '/safety-check-confirm',
        method: 'post',
        data
    })
}

// 查询-根据人员ID查询对应的考核表
export function getExamFormByPersonId(params) {
    return handleRequest({
        url: '/safety-check/personId',
        method: 'get',
        params
    })
}

// 查询-考核表表头
export function getExamFormHeader(params) {
    return handleRequest({
        url: '/safety-check/head',
        method: 'get',
        params
    })
}


/**
 * 
 * @description 个人考核相关
 */

  // 查询(维护个人页面使用)
export function getPersonalExamByJob(params) {
    return handleRequest({
        url: '/safety-check/employeeId',
        method: 'get',
        params
    })
}
 // 查询
 export function getPersonalExamByOrg(params) {
     return handleRequest({
         url: '/safety-check/employeeId-projectId',
         method: 'get',
         params
     })
 }

 // 查询-个人考核列表
 export function getPersonalExamList(data) {
     return handleRequest({
         url: '/safety-check/person-query',
         method: 'post',
         data
     })
 }
 
// 查看-个人考核详情
export function getPersonalExamDetail(params) {
    return handleRequest({
        url: '/safety-check/person',
        method: 'get',
        params
    })
}

// 新增-个人考核
export function addPersonalExam(data) {
    return handleRequest({
        url: '/safety-check/person',
        method: 'post',
        data
    })
}
// 新增-个人考核(提交按钮)
export function addPersonalExamSubmit(params) {
    return handleRequest({
        url: '/safety-check/person-status',
        method: 'post',
        params
    })
}

// 修改-个人考核
export function updatePersonalExam(data) {
    return handleRequest({
        url: '/safety-check/person/update',
        method: 'post',
        data
    })
}

// 删除-个人考核项
export function deletePersonalExamItem(data) {
    return handleRequest({
        url: '/safety-check/person-item',
        method: 'post',
        data
    })
}
// 统计
export function GetCount(data) {
    return handleRequest({
        url: '/safety-check/count',
        method: 'post',
        data
    })
}